FileChooserWidget: Avoid crash freeing static str
authorDaniel Boles <dboles@src.gnome.org>
Mon, 12 Mar 2018 22:44:37 +0000 (22:44 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 12 Mar 2018 23:07:50 +0000 (23:07 +0000)
commitfc9dc97430ec276dfb804059fe74d1ea3d899455
tree3f08e121a0ec09941536d746d96e2da84d7dc3cd
parentd11c78c46f496ca9fc9cc7062d8acb7d80228574
FileChooserWidget: Avoid crash freeing static str

Having a FileChooserDialog in location-entry mode then pressing
<primary>f to move to search mode would crash with an invalid free().

In that case, FileChooserWidget.get_subtitle() returned a static string
straight from gettext. This crashed when the GBinding from :subtitle to
FileChooserDialog’s HeaderBar:subtitle shortly tried to free the string.

Fix by duplicating the string before returning it, like all other paths.

https://bugzilla.gnome.org/show_bug.cgi?id=791004
gtk/gtkfilechooserwidget.c